#include <sys_config.h>
#include <basic_types.h>
#include <mediatypes.h>
#include <api/libc/alloc.h>
#include <api/libc/printf.h>
#include <api/libc/string.h>
#include <osal/osal.h>
#include <hld/hld_dev.h>
#include <hld/crypto/crypto.h>

RET_CODE ce_ioctl(CE_DEVICE *pCeDev,UINT32 cmd,UINT32 param)
{
   RET_CODE ret = RET_FAILURE;

   if(pCeDev == NULL)
     return ALI_CRYPTO_ERROR_DRIVER_NOT_INITIALIZED;
   
   if(pCeDev->ioctl)
   {
		ret = pCeDev->ioctl( pCeDev, cmd&0xff, param);
   }

   return ret ;
}

RET_CODE ce_key_generate(CE_DEVICE *pCeDev,CE_DATA_INFO *pCe_data_info)
{
   RET_CODE ret = RET_FAILURE;

   if(pCeDev == NULL)
     return ALI_CRYPTO_ERROR_DRIVER_NOT_INITIALIZED;
   
   if(pCeDev->key_generate)
   {
		ret = pCeDev->key_generate( pCeDev,pCe_data_info);
   }
   return ret ;
}

RET_CODE ce_key_load(CE_DEVICE *pCeDev,pOTP_PARAM pCe_opt_info)
{
   RET_CODE ret = RET_FAILURE;

   if(pCeDev == NULL)
     return ALI_CRYPTO_ERROR_DRIVER_NOT_INITIALIZED;
   
   if(pCeDev->key_load)
   {
		ret = pCeDev->key_load( pCeDev,pCe_opt_info);
   }

   return ret ;
}

